'use strict';

module.exports = {
    up: async(queryInterface, Sequelize) => {
        const { INTEGER, DATE, STRING } = Sequelize;
        // 创建表
        await queryInterface.createTable('livesp', {
            id: {
                type: INTEGER(20).UNSIGNED,
                primaryKey: true,
                autoIncrement: true
            },
            videoname: {
                type: STRING(50),
                allowNull: false,
                defaultValue: '',
                comment: '视频名称',
            },
            videourl: {
                type: STRING(130),
                allowNull: false,
                defaultValue: '',
                comment: '视频路径',
            },
            imageurl: {
                type: STRING(130),
                allowNull: false,
                defaultValue: '',
                comment: '图片路径',
            },
            order: {
                type: STRING(50),
                allowNull: false,
                defaultValue: '',
                comment: '视频简介',
            },
            created_at: DATE,
            updated_at: DATE
        });
    },

    down: async queryInterface => {
        await queryInterface.dropTable('livesp');
    }
};